package com.weiz;

import com.weiz.service.SnowflakeService;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.scheduling.annotation.EnableScheduling;

@EnableScheduling
@SpringBootApplication
public class RabbitMQTestApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext applicationContext = SpringApplication.run(RabbitMQTestApplication.class, args);
        SnowflakeService bean =applicationContext.getBean(SnowflakeService.class);
        //1869937236225556480  19位
        long uid = bean.generateUniqueId();
        String uidStr =bean.generateUniqueIdStr();
        System.out.println(uid);
        System.out.println(uidStr);
    }

}
